package com.graduate.work.graduatework.service;

import com.graduate.work.graduatework.entity.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: cuibingqi.
 * @date: 17/5/4 下午3:47.
 * @descripe:
 */
@Service
public class CommentService {

    @Autowired
    private DataAcessService dataAcessService;

    /**
     * 添加评论
     * @param comment
     * @return
     */
    public boolean addComment(Comment comment){

        boolean result = dataAcessService.addComment(comment);

        System.out.println(result);
        return result;
    }

    /**
     * 删除评论
     * @param id
     * @return
     */
    public boolean deleteComment(int id){

        boolean result = dataAcessService.deleteComment(id);

        System.out.println(result);
        return result;
    }

   public List<Comment> selectComment(String flightNumber){

        List<Comment> result = dataAcessService.selectComment(flightNumber);

        System.out.println(result);
        return result;
   }

}
